#include <iostream>
using namespace std;

int main(int argc, char* argv []) {
	short a = 0b0000000100000010;
	cout << sizeof(short) << endl;
	cout << "a = " << a << endl;
	char byte = *((char*)&a);
	cout << "last byte of a = " << (short)*((char*)&a) << endl;

	short b = a >> 1;
	cout << "b = " << b << endl;
	char byteB = *((char*)&b);
	cout << "last byte of b = " << (short)(unsigned char)byteB << endl;
	cout << "inversion= " <<  (short)~0xfff1 << endl;

	int intA = 0x80000000;
	cout << "intA = " << intA << endl;
	cout << "(unsigned)intA = " << (unsigned int)intA << endl;


	return 0;

}
